<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Extents - MIL-STD-1553 Command Word example</title>
    <link href="css/samples.css" rel="stylesheet" type="text/css">
    <!--[if IE]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
    <script language="javascript" type="text/javascript" src="js/jquery.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/jquery.flot.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/jquery.flot.extents.js"></script>
</head><body><div id="page-content">
    <h1>Extents - MIL-STD-1553 CW example</h1>

    <p>MIL-STD-1553 Command Word consists of:</p>
    <ol>
        <li>SYNC - synchrosequence marking beginning of word and indicating word type</li>
        <li>ADDR - address of Remote Terminal on a Bus or 11111 for broadcast message</li>
        <li>T/R - Transmit|Receive flag (1 -- Remote Terminal transmits data)</li>
        <li>CA/C - Subaddress in Remote Terminal or 00000/11111 in Control Message</li>
        <li>WC/MODE - Count of Data Words or Control Mode</li>
        <li>PAR - Parity bit (entire word should be ODD)</li>
    </ol>
    <p>Here goes the waweform for SYNCRRONIZE BROADCAST control message (consists of single
       word 11111-1-00000-000001 or 0xFC01):</p>

    <div id="placeholder" style="width:600px;height:300px;position:relative;"></div>

    <div class="cr_footer">Released under GPLv2, (C) 2012 Serge V. Izmaylov</div>
</div>
<script type="text/javascript">
$(function () {
    var d1 = {
                label: "Manchester signal",
                data: [
                    // inactive line
                    [-0.9, 0], [-0.1, 0],
                    // SYNC
                    [0.1, 5], [0.4, 5], [0.6, 5], [0.9, 5],
                    [1.1, 5], [1.4, 5], [1.6, -5], [1.9, -5],
                    [2.1, -5], [2.4, -5], [2.6, -5], [2.9, -5],
                    // ADDR
                    [3.1, 5], [3.4, 5], [3.6, -5], [3.9, -5],
                    [4.1, 5], [4.4, 5], [4.6, -5], [4.9, -5],
                    [5.1, 5], [5.4, 5], [5.6, -5], [5.9, -5],
                    [6.1, 5], [6.4, 5], [6.6, -5], [6.9, -5],
                    [7.1, 5], [7.4, 5], [7.6, -5], [7.9, -5],
                    // T/R
                    [8.1, 5], [8.4, 5], [8.6, -5], [8.9, -5],
                    // SA/C
                    [9.1, -5], [9.4, -5], [9.6, 5], [9.9, 5],
                    [10.1, -5], [10.4, -5], [10.6, 5], [10.9, 5],
                    [11.1, -5], [11.4, -5], [11.6, 5], [11.9, 5],
                    [12.1, -5], [12.4, -5], [12.6, 5], [12.9, 5],
                    [13.1, -5], [13.4, -5], [13.6, 5], [13.9, 5],
                    // WC/MODE
                    [14.1, -5], [14.4, -5], [14.6, 5], [14.9, 5],
                    [15.1, -5], [15.4, -5], [15.6, 5], [15.9, 5],
                    [16.1, -5], [16.4, -5], [16.6, 5], [16.9, 5],
                    [17.1, -5], [17.4, -5], [17.6, 5], [17.9, 5],
                    [18.1, 5], [18.4, 5], [18.6, -5], [18.9, -5],
                    // PAR
                    [19.1, -5], [19.4, -5], [19.6, 5], [19.9, 5],
                    // inactive line
                    [20.1, 0], [20.9, 0]
                ]
    };
    var d2 = {extents: { show: true, barVAlign: "top", rows: 2, rowHeight: 40, barVAlign: "bottom" }, data: [], extentdata: [
        {label: 'SYNC', start: 0.0, end: 3.0},
        {label: 'ADDR', start: 3.0, end: 8.0, depends: [0]},
        {label: 'T/R', start: 8.0, end: 9.0, depends: [1]},
        {label: 'SA/C', start: 9.0, end: 14.0, depends: [2]},
        {label: 'WC/MODE', start: 14.0, end: 19.0, depends: [3]},
        {label: 'PAR', start: 19.0, end: 20.0, depends: [4]}
    ]};

    $.plot($("#placeholder"), [ d1, d2 ], {
        xaxis: { min: -1, max: 21, tickFormatter: function (t) { return t.toString() + "us"; }, ticks: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20] },
        yaxis: { min: -15, max: 10, tickFormatter: function (v) { return v.toString() + "V"; } }
    });
});
</script></body></html>
